package com.service.zk;

import com.bean.zk.Power;
import com.dao.zk.PowerDAO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class ResourceService {

    @Resource
    private PowerDAO powerDAO;

    public List<Power> getPowers(){
        List<Power> allPowers = powerDAO.getPowers();
        return allPowers;
    }

    /**
     * 获取所有父节点
     * @return
     */
    public List<Power>  get(){

        return  powerDAO.getFanodes();
    }


    public List<Power> sel(String p_name, String fanode) {
        return powerDAO.getPowersblur(p_name, Integer.parseInt(fanode));
    }

    public List<Power> getByPid(String power_id) {
        return powerDAO.getByPid(Integer.parseInt(power_id));
    }

    public int updatePower(Power power) {
        return powerDAO.updatePower(power);
    }
}
